package com.xy.biz.ts.domain.enums;

import com.xy.lang.domain.KeyValue;
import com.xy.lang.enums.CodeEnum;

/**
 * @author Greekn Zhang
 * @date 2021/12/1 9:28
 * @description
 */
public enum TrainNodeEnum implements CodeEnum {
    UNFINISHED(-1, "未完成"),
    THIS_WEEK(7, "本周"),
    THIS_MONTH(8, "本月"),
    NEXT_MONTH(3, "下周"),
    WITHIN_THREE_MONTH(4, "近三月"),
    WITHIN_HALF_A_YEAR(5, "近半年"),
    WITHIN_A_YEAR(6, "近一年");

    private int code;
    private String name;

    TrainNodeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    @Override
    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public KeyValue<Integer, String> toKeyValue() {
        return new KeyValue<>(this.code, this.name);
    }
}
